package com.yand.thread.rabbitRun2;

public class CallbackImpl implements Callback {


    private Rabbit rabbit;

    private Tortoise tortoise;


    public CallbackImpl(Rabbit rabbit, Tortoise tortoise){
      this.rabbit = rabbit;
      this.tortoise = tortoise;
    }


    public void stopRabbit() {
        try {
            rabbit.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
            rabbit.interrupt();
        }




    }

    @Override
    public void stopTortoise() {
        try {
            tortoise.sleep(100);

        } catch (InterruptedException e) {
            e.printStackTrace();
            tortoise.interrupt();
        }
    }


}
